package com.cloudsigns.factorymanager2.engineering.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.cloudsigns.factorymanager2.BaseActivity;
import com.cloudsigns.factorymanager2.R;

public class EngineeringSurveyCompletionOrderForManagerActivity extends BaseActivity{
    private View rl_back;
    private TextView tv_title;
    private TextView tv_engineering_name,tv_project_name;
    private ImageView img_project_select;
    private LinearLayout ll_project_content;
    private TextView edt_project_manager,edt_engineering_manager,edt_engineering_team,edt_completed_date,edt_finish_date;

    @Override
    protected void onBaseCreate(Bundle savedInstanceState) {
        setContentView(R.layout.layout_engineering_survey_completion_order_for_manager);
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        rl_back=findViewById(R.id.rl_back);
        tv_title=findViewById(R.id.tv_title);
        tv_engineering_name=findViewById(R.id.tv_engineering_name);
        tv_project_name=findViewById(R.id.tv_project_name);
        img_project_select=findViewById(R.id.img_project_select);
        ll_project_content=findViewById(R.id.ll_project_content);
        edt_project_manager=findViewById(R.id.edt_project_manager);
        edt_engineering_manager=findViewById(R.id.edt_engineering_manager);
        edt_engineering_team=findViewById(R.id.edt_engineering_team);
        edt_completed_date=findViewById(R.id.edt_completed_date);
        edt_finish_date=findViewById(R.id.edt_finish_date);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        tv_title.setText("现场勘察");
        img_project_select.setBackgroundResource(R.mipmap.arrow_down_icon);
    }

    @Override
    public void setListener() {
        rl_back.setOnClickListener(this);
        img_project_select.setOnClickListener(this);
    }

    private void showEngineeringInfoDialog() {
        if (ll_project_content.getVisibility() == View.VISIBLE) {
            ll_project_content.setVisibility(View.GONE);
            img_project_select.setBackgroundResource(R.mipmap.arrow_down_icon);
        } else {
            ll_project_content.setVisibility(View.VISIBLE);
            img_project_select.setBackgroundResource(R.mipmap.arrow_top);
        }
    }

    @Override
    public void widgetClick(View v) {
        switch (v.getId()){
            case R.id.rl_back:
                finish();
                break;
            case R.id.img_project_select:
                showEngineeringInfoDialog();
                break;
        }
    }
}
